# $Id$
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: laloch <laloch@atlas.cz>

pkgname=qt-gstreamer
pkgver=1.2.0
pkgrel=1
arch=(i686 x86_64)
pkgdesc="Qt bindings for GStreamer"
url='http://gstreamer.freedesktop.org/modules/qt-gstreamer.html'
license=(LGPL2.1)
depends=(qt5-declarative gst-plugins-good)
makedepends=(cmake boost doxygen)
conflicts=(qt5-gstreamer)
provides=(qt5-gstreamer)
replaces=(qt5-gstreamer)
source=("https://gstreamer.freedesktop.org/src/$pkgname/$pkgname-$pkgver.tar.xz"
	qt-gstreamer-1.6.patch::"http://cgit.freedesktop.org/gstreamer/qt-gstreamer/patch/?id=e2ca8094")
md5sums=('fd794045a828c184acc1794b08a463fd'
         'e39d0c9ba100b18b230d16ff22d8db5d')

prepare() {
  mkdir -p build

# Fix build with gstreamer 1.6
  cd $pkgbase-$pkgver
  patch -p1 -i ../qt-gstreamer-1.6.patch
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DQTGSTREAMER_EXAMPLES=OFF \
    -DQT_VERSION=5
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}
